//文件上传并加载显示.
/**不使用传值而使用getValue是为了兼容动态表单的赋值使用. 使用动态表单时,businessTableName的id就为businessTableName
 *  businessId的id就为businessId
 * 
 * loadImageId:用于显示图片的img标签的id
 * businessTableName:隐藏域用于存businessTableName的id.
 * fileContentTypeName:文件类型,如雇员,福利
 * businessId:隐藏域用于存businessId的id.
 * 
 */

	var file_doFileUpload = function(e,loadImgId,fileInputId,fileBrowserHtmlId,businessTableName,fileContentTypeName,businessId,isAvatarImageReserveValue,showType,callback_fun) {
		var businessTableNameValue ="";
		var businessValue = "";
		if(mini.get(businessTableName) == undefined || mini.get(businessTableName) == null) {
			businessTableNameValue = businessTableName;
		} else {
			businessTableNameValue = mini.get(businessTableName).getValue();
		}
		
		if(mini.get(businessId) == undefined || mini.get(businessId) == null) {
			businessValue = businessId;
		} else {
			businessValue = mini.get(businessId).getValue();
		}
		
		var fileInput = mini.get(fileInputId);
		var json = {
			"businessTableName" : businessTableNameValue,
			"fileContentTypeName" : fileContentTypeName,
			"businessTableId"	: businessValue,
			"isAvatarImageReserve" : isAvatarImageReserveValue
		};
		if(!public_isEmpty(fileInput)){
			json.fileId = fileInput.getValue();
		}
		public_ajaxFileUpload(base + "/hrp/xt/upload/controller/xtUploadFile/updateUpload", fileBrowserHtmlId,
			json, function(ret_public_ajaxFileUpload) {
			if (ret_public_ajaxFileUpload.ok) {
				mini.get(fileInputId).setValue(ret_public_ajaxFileUpload.data);
				public_loadImageFromServer(loadImgId,showType,ret_public_ajaxFileUpload.data);
				callback_fun(ret_public_ajaxFileUpload.data);
			}
			public_showTip(ret_public_ajaxFileUpload);
		});
	}
